
point_test.o:     file format elf32-littlearm


Disassembly of section .text:

00000000 <point_1>:
#include <stdio.h>

int point_1(void)
{
   0:	e92d4800 	push	{fp, lr}
   4:	e28db004 	add	fp, sp, #4
   8:	e24dd008 	sub	sp, sp, #8
	char* str = "ABCDEFGHIJKL";
   c:	e59f3058 	ldr	r3, [pc, #88]	; 6c <point_1+0x6c>
  10:	e50b3008 	str	r3, [fp, #-8]
    int* pInt = (int*)str;
  14:	e51b3008 	ldr	r3, [fp, #-8]
  18:	e50b300c 	str	r3, [fp, #-12]

    printf("%c\n%c\n",*(str+1),*(char *)(pInt+1));	// B	E
  1c:	e51b3008 	ldr	r3, [fp, #-8]
  20:	e2833001 	add	r3, r3, #1
  24:	e5d33000 	ldrb	r3, [r3]
  28:	e1a01003 	mov	r1, r3
  2c:	e51b300c 	ldr	r3, [fp, #-12]
  30:	e2833004 	add	r3, r3, #4
  34:	e5d33000 	ldrb	r3, [r3]
  38:	e1a02003 	mov	r2, r3
  3c:	e59f002c 	ldr	r0, [pc, #44]	; 70 <point_1+0x70>
  40:	ebfffffe 	bl	0 <printf>

	printf("%c\n", *(char *)(pInt+2));	// I
  44:	e51b300c 	ldr	r3, [fp, #-12]
  48:	e2833008 	add	r3, r3, #8
  4c:	e5d33000 	ldrb	r3, [r3]
  50:	e1a01003 	mov	r1, r3
  54:	e59f0018 	ldr	r0, [pc, #24]	; 74 <point_1+0x74>
  58:	ebfffffe 	bl	0 <printf>

    return 0;
  5c:	e3a03000 	mov	r3, #0
}
  60:	e1a00003 	mov	r0, r3
  64:	e24bd004 	sub	sp, fp, #4
  68:	e8bd8800 	pop	{fp, pc}
  6c:	00000000 	.word	0x00000000
  70:	00000010 	.word	0x00000010
  74:	00000018 	.word	0x00000018

00000078 <point_2>:

void point_2()
{
  78:	e92d4800 	push	{fp, lr}
  7c:	e28db004 	add	fp, sp, #4
  80:	e24dd008 	sub	sp, sp, #8
	char *str = "abcdef";
  84:	e59f3020 	ldr	r3, [pc, #32]	; ac <point_2+0x34>
  88:	e50b3008 	str	r3, [fp, #-8]

	printf("%s\n", str);
  8c:	e51b0008 	ldr	r0, [fp, #-8]
  90:	ebfffffe 	bl	0 <puts>

	//*str = "fedcba";	// error : 单个字符赋值
	str = "fedcba";	// error : 单个字符赋值
  94:	e59f3014 	ldr	r3, [pc, #20]	; b0 <point_2+0x38>
  98:	e50b3008 	str	r3, [fp, #-8]
	printf("%s\n", str);
  9c:	e51b0008 	ldr	r0, [fp, #-8]
  a0:	ebfffffe 	bl	0 <puts>

	//str[2] = 'C';		//修改第三个字符为大写		Segmentation fault
	//printf("%s\n", str);
}
  a4:	e24bd004 	sub	sp, fp, #4
  a8:	e8bd8800 	pop	{fp, pc}
  ac:	0000001c 	.word	0x0000001c
  b0:	00000024 	.word	0x00000024

000000b4 <estimate_mode>:


static char *estimate_mode(unsigned short *pmode)
{
  b4:	e52db004 	push	{fp}		; (str fp, [sp, #-4]!)
  b8:	e28db000 	add	fp, sp, #0
  bc:	e24dd014 	sub	sp, sp, #20
  c0:	e50b0010 	str	r0, [fp, #-16]
	char *msg = 0;
  c4:	e3a03000 	mov	r3, #0
  c8:	e50b3008 	str	r3, [fp, #-8]

	if (*pmode == 0x00) {
  cc:	e51b3010 	ldr	r3, [fp, #-16]
  d0:	e1d330b0 	ldrh	r3, [r3]
  d4:	e3530000 	cmp	r3, #0
  d8:	1a000002 	bne	e8 <estimate_mode+0x34>
		msg = "Standby";
  dc:	e59f304c 	ldr	r3, [pc, #76]	; 130 <estimate_mode+0x7c>
  e0:	e50b3008 	str	r3, [fp, #-8]
  e4:	ea00000c 	b	11c <estimate_mode+0x68>
	}
	else if (*pmode == 0x01) {
  e8:	e51b3010 	ldr	r3, [fp, #-16]
  ec:	e1d330b0 	ldrh	r3, [r3]
  f0:	e3530001 	cmp	r3, #1
  f4:	1a000002 	bne	104 <estimate_mode+0x50>
		msg = "Working";
  f8:	e59f3034 	ldr	r3, [pc, #52]	; 134 <estimate_mode+0x80>
  fc:	e50b3008 	str	r3, [fp, #-8]
 100:	ea000005 	b	11c <estimate_mode+0x68>
	}
	else if (*pmode == 0x02) {
 104:	e51b3010 	ldr	r3, [fp, #-16]
 108:	e1d330b0 	ldrh	r3, [r3]
 10c:	e3530002 	cmp	r3, #2
 110:	1a000001 	bne	11c <estimate_mode+0x68>
		msg = "Error";
 114:	e59f301c 	ldr	r3, [pc, #28]	; 138 <estimate_mode+0x84>
 118:	e50b3008 	str	r3, [fp, #-8]
	}

	return msg;
 11c:	e51b3008 	ldr	r3, [fp, #-8]
}
 120:	e1a00003 	mov	r0, r3
 124:	e24bd000 	sub	sp, fp, #0
 128:	e49db004 	pop	{fp}		; (ldr fp, [sp], #4)
 12c:	e12fff1e 	bx	lr
 130:	0000002c 	.word	0x0000002c
 134:	00000034 	.word	0x00000034
 138:	0000003c 	.word	0x0000003c

0000013c <main>:


int main()
{
 13c:	e92d4800 	push	{fp, lr}
 140:	e28db004 	add	fp, sp, #4
 144:	e24dd008 	sub	sp, sp, #8
	short i = 0;
 148:	e3a03000 	mov	r3, #0
 14c:	e14b30b6 	strh	r3, [fp, #-6]

	point_1();
 150:	ebfffffe 	bl	0 <point_1>
	point_2();	
 154:	ebfffffe 	bl	78 <point_2>
	printf("%s\n", estimate_mode(&i));
 158:	e24b3006 	sub	r3, fp, #6
 15c:	e1a00003 	mov	r0, r3
 160:	ebffffd3 	bl	b4 <estimate_mode>
 164:	e1a03000 	mov	r3, r0
 168:	e1a00003 	mov	r0, r3
 16c:	ebfffffe 	bl	0 <puts>
	
	return 0;
 170:	e3a03000 	mov	r3, #0
}
 174:	e1a00003 	mov	r0, r3
 178:	e24bd004 	sub	sp, fp, #4
 17c:	e8bd8800 	pop	{fp, pc}
